<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>项目添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../style/wangeditor.css">
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加项目信息':action=='Modify'?'修改项目信息':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'project', 'form': 'dataForm' ,'primary_key':'Project_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">项目信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">项目名称</div>
              </template>
              <el-form-item prop="Project_Name" :rules="[{ required: true, message: '请输入项目名称', trigger: 'blur' }]">
                <el-input v-model="dataForm.Project_Name" class="borderless-input" placeholder="请输入项目名称" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">项目类别</div>
              </template>
              <el-form-item prop="Project_Name" :rules="[{ required: true, message: '请输入项目类别', trigger: 'change' }]">
                <el-select clearable v-model.trim="dataForm.Project_Category_SerialNumber" placeholder="请选择项目类别"
                  filterable style="width: 100%">
                  <el-option v-for="(item,index) in project_category" :key="index" :label="item.Project_Category"
                    :value="item.Project_Category_SerialNumber"></el-option>
                </el-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">项目总预算金额</div>
              </template>
              <el-form-item prop="Project_Budget" :rules="[{ required: true, message: '请输入项目总预算金额', trigger: 'blur' }]">
                <el-input v-model="dataForm.Project_Budget" class="borderless-input" placeholder="请输入项目总预算金额" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">项目描述</div>
              </template>
              <el-form-item prop="Project_Description">
                <el-input type="textarea" :autosize="{ minRows: 2}" v-model="dataForm.Project_Description"
                  class="borderless-input" placeholder="请输入项目描述" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">项目实施主体</div>
              </template>
              <el-form-item prop="Project_Implementation_Subject"
                :rules="[{ required: true, message: '请选择项目实施主体', trigger: 'change' }]">
                <yl-cascader
                  :props="{ value:'Government_Agencies_SerialNumber', label:'Agensies_Name' ,checkStrictly: true }"
                  v-model="dataForm.Project_Implementation_Subject" placeholder="请选择项目实施主体"
                  :options="government_agencies"></yl-cascader>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">项目负责人</div>
              </template>
              <el-form-item prop="Project_Captain_SerialNumber"
                :rules="[{ required: true, message: '请选择项目负责人', trigger: 'change' }]">
                <yl-select v-model="dataForm.Project_Captain_SerialNumber" clearable filterable placeholder="请选择项目负责人"
                  :options="government_member_information.filter(i=>i.Row_Status!='1')"
                  :props="{value:'ID_Card_Number',label:'Personal_Name'}">
                  <el-table-column prop="ID_Card_Number" show-overflow-tooltip label="身份证号"></el-table-column>
                  <el-table-column prop="Personal_Name" show-overflow-tooltip label="姓名"></el-table-column>
                  <el-table-column prop="Gender" show-overflow-tooltip label="性别"></el-table-column>
                  <el-table-column prop="Home_Address" label="家庭住址"></el-table-column>
                  <el-table-column prop="Contact_Phone" label="联系方式"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">预计开始日期</div>
              </template>
              <el-form-item prop="Start_Date" :rules="[{ required: true, message: '请选择预计开始日期', trigger: 'change' }]">
                <el-date-picker v-model="dataForm.Start_Date" type="date" placeholder="请选择预计开始日期"
                  class="borderless-input" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="large" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">预计结束日期</div>
              </template>
              <el-form-item prop="End_Date" :rules="[{ required: true, message: '请选择预计结束日期', trigger: 'change' }]">
                <el-date-picker v-model="dataForm.End_Date" type="date" placeholder="请选择预计结束日期" class="borderless-input"
                  format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="large" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">相关自然资源</div>
              </template>
              <el-form-item prop="Natural_Resource_SerialNumber"
                :rules="[{ required: true, message: '请选择自然资源', trigger: 'change' }]">
                <yl-select v-model="dataForm.Natural_Resource_SerialNumber" clearable filterable placeholder="请选择自然资源"
                  :options="natural_resources_management"
                  :props="{value:'Natural_Resource_SerialNumber',label:'Natural_Resource_Name',multiple :true}">
                  <el-table-column prop="Natural_Resource_SerialNumber" show-overflow-tooltip
                    label="自然资源流水号"></el-table-column>
                  <el-table-column prop="Natural_Resource_Name" show-overflow-tooltip label="自然资源名称"></el-table-column>
                  <el-table-column prop="Area" label="自然资源面积"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">备注</div>
              </template>
              <el-form-item prop="Remarks">
                <el-input type="textarea" :autosize="{ minRows: 2}" v-model="dataForm.Remarks" class="borderless-input"
                  placeholder="请输入备注" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">紧急等级</div>
              </template>
              <el-form-item prop="Emergency_Sign" :rules="[{ required: true, message: '请输入紧急等级', trigger: 'blur' }]">
                <el-select clearable v-model.trim="dataForm.Emergency_Sign" placeholder="请选择紧急等级" filterable
                  style="width: 100%">
                  <el-option v-for="(item,index) in project_emergency" :key="index" :label="item.Emergency_Sign"
                    :value="item.Project_Emergency_SerialNumber">
                    <div style="display: flex;align-items: center;">
                      <div style="width: 10px;height: 10px;border-radius: 50%;" :style="{backgroundColor:item.Color}">
                      </div>
                      <span style="margin-left: 10px;">{{item.Emergency_Sign}}</span>
                    </div>
                  </el-option>
                </el-select>
              </el-form-item>
            </el-descriptions-item>
          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">附件</div>
          </div>
          <el-descriptions :column="2" size="large" border
            :data-options="JSON.stringify({'TableName': 'project_attachment', 'form': 'childDataForm2', 'ParentTableName': 'project'})">
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">项目附件</div>
              </template>
              <yl-upload ref="ylUpload" drag @success="(row, res)=>{this.success(row, res,'0')}" @remove="remove"
                :limit="99" :file="fileList"></yl-upload>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">申报材料</div>
              </template>
              <yl-upload ref="ylUpload" drag @success="(row, res)=>{this.success(row, res,'1')}" @remove="remove"
                :limit="99" :file="fileList2"></yl-upload>
            </el-descriptions-item>
          </el-descriptions>
          <div class="table_titel">
            <div class="titel">项目节点</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm:childDataForm.filter(item => item.Row_Status != '1')}" ref="form1"
            :inline-message="true" style="width: 100%">
            <el-descriptions :column="2" size="large" border style="margin-bottom: 10px;"
              v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')" :key="index"
              :data-options="JSON.stringify({ 'TableName': 'project_node', 'form': 'childDataForm', 'ParentTableName': 'project'})">
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">节点名称</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Project_Node'"
                  :rules="[{ required: true, message: '请输入节点名称', trigger: 'blur' }]">
                  <el-input v-model="item.Project_Node" class="borderless-input" placeholder="请输入节点名称" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">项目节点负责人</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Project_Node_Captain_SerialNumber'"
                  :rules="[{ required: true, message: '请选择项目节点负责人', trigger: 'change' }]">
                  <yl-select v-model="item.Project_Node_Captain_SerialNumber" clearable filterable
                    placeholder="请选择项目节点负责人" :options="government_member_information"
                    :props="{value:'ID_Card_Number',label:'Personal_Name'}">
                    <el-table-column prop="ID_Card_Number" show-overflow-tooltip label="身份证号"></el-table-column>
                    <el-table-column prop="Personal_Name" show-overflow-tooltip label="姓名"></el-table-column>
                    <el-table-column prop="Gender" show-overflow-tooltip label="性别"></el-table-column>
                    <el-table-column prop="Home_Address" label="家庭住址"></el-table-column>
                    <el-table-column prop="Contact_Phone" label="联系方式"></el-table-column>
                  </yl-select>
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">项目节点描述</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Project_Node_Description'">
                  <el-input type="textarea" :autosize="{ minRows: 2}" v-model="item.Project_Node_Description"
                    class="borderless-input" placeholder="请输入项目节点描述" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">备注</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Project_Node_Remarks'">
                  <el-input type="textarea" :autosize="{ minRows: 2}" v-model="item.Project_Node_Remarks"
                    class="borderless-input" placeholder="请输入备注" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">预期工期开始日期</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Project_Node_Start_Date'"
                  :rules="[{ required: true, message: '请选择开始日期', trigger: 'change' }]">
                  <el-date-picker v-model="item.Project_Node_Start_Date" type="date" placeholder="请选择开始日期"
                    class="borderless-input" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="large" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">预期工期结束日期</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Project_Node_End_Date'"
                  :rules="[{ required: true, message: '请输入结束日期', trigger: 'change' }]">
                  <el-date-picker v-model="item.Project_Node_End_Date" type="date" placeholder="请选择结束日期"
                    class="borderless-input" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="large" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">项目节点预算金额</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Project_Node_Budget'"
                  :rules="[{ required: true, message: '请输入项目节点预算金额', trigger: 'blur' }]">
                  <el-input v-model="item.Project_Node_Budget" class="borderless-input" placeholder="请输入项目节点预算金额" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">施工单位号</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Construction_Company_SerialNumber'"
                  :rules="[{ required: true, message: '请输入施工单位号', trigger: 'blur' }]">
                  <el-input v-model="item.Construction_Company_SerialNumber" class="borderless-input"
                    placeholder="请输入施工单位号" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">施工单位名称</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Construction_Company_Name'"
                  :rules="[{ required: true, message: '请输入施工单位名称', trigger: 'blur' }]">
                  <el-input v-model="item.Construction_Company_Name" class="borderless-input" placeholder="请输入施工单位名称" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">施工单位联系方式</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Construction_Company_Contacts'"
                  :rules="[{ required: true, message: '请输入施工单位联系方式', trigger: 'blur' }]">
                  <el-input v-model="item.Construction_Company_Contacts" class="borderless-input"
                    placeholder="请输入施工单位联系方式" />
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
          <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'project_natural_resource', 'form': 'childDataForm1', 'ParentTableName': 'project'})"></el-descriptions>
          <div class="table_titel">
            <div class="titel">资金来源</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm3')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm3')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm3:childDataForm3.filter(item => item.Row_Status != '1')}" ref="form2"
            :inline-message="true" style="width: 100%">
            <el-descriptions :column="2" size="large" border style="margin-bottom: 10px;"
              v-for="(item,index) in childDataForm3.filter(item => item.Row_Status != '1')" :key="index"
              :data-options="JSON.stringify({ 'TableName': 'project_funds_source', 'form': 'childDataForm3', 'ParentTableName': 'project'})">
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">资金来源</div>
                </template>
                <el-form-item :prop="'childDataForm3.'+index+'.Funds_Source_SerialNumber'"
                  :rules="[{ required: true, message: '请选择资金来源', trigger: 'blur' }]">
                  <el-select clearable v-model.trim="item.Funds_Source_SerialNumber" placeholder="请选择资金来源" filterable
                    style="width: 100%">
                    <el-option v-for="(item,index) in funds_source" :key="index" :label="item.Funds_Source"
                      :value="item.Funds_Source_SerialNumber">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">资金金额</div>
                </template>
                <el-form-item :prop="'childDataForm3.'+index+'.Amount'">
                  <el-input v-model="item.Amount" class="borderless-input" placeholder="请输入资金金额" />
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>